$(window).load(function(){
	var aF_arr=[],
	aF=$1(".floor_list"),
		scrollT=document.documentElement.scrollTop||document.body.scrollTop,
		oF=$1("#floor"),
		aF_li=oF.getElementsByTagName("li"),
		aF_arr=[],
		timer_floor=null;
	$(".floor_list").each(function(){
		//console.log($(this).offset());
		aF_arr.push($(this).offset().top)
	});
	console.log(aF_arr);
	//楼梯效果
	
	for(var i=0;i<aF_li.length;i++){
		(function(i){
			aF_li[i].onclick=function(){
			clearInterval(timer_floor);
			timer_floor=setInterval(function(){
				scrollT=document.documentElement.scrollTop||document.body.scrollTop,
			 	speed=Math.round((aF_arr[i]-scrollT)/5);
			 	if(i==aF_li.length-1){
					speed=Math.round(-scrollT/5);
				}
				document.documentElement.scrollTop=document.body.scrollTop=scrollT+speed;
				if(speed==0){
					clearInterval(timer_floor);
				}
			},30)
			}
		})(i)
	}
})
$(function(){
	//banner图轮播
	
	var j=0,
		oBt=$1("#banner_turn"),
		oShare=$1("#share"),
		aLi=oBt.getElementsByTagName("li"),
		timer=setInterval(move,3000);
		
	function move(){
		j++;
		if(j==6){
			j=0;
		}
		for(var i=0;i<aLi.length;i++){
			aLi[i].style.opacity=0;
			aLi[i].style.filter = 'alpha(opacity:0)';  //IE
		}
		startMove(aLi[j],{opacity:100})
	}
	//分享到移入移出
	oShare.onmouseover=function(){
		clearInterval(oShare.timer)
		startMove(oShare,{right:0})
	}
	oShare.onmouseout=function(){
		clearInterval(oShare.timer)
		startMove(oShare,{right:-272})
	}
	
	//楼梯滚动条跟随出现
	console.log($(".floor_list:eq(0)").offset().top);
	$(window).scroll(function(){
		var scrollTop=document.documentElement.scrollTop||document.body.scrollTop,
			floorTop=$(".floor_list:eq(0)").offset().top;
			console.log($(".floor_list:eq(0)").offset().top);
			if(scrollTop>=floorTop){
				$("#floor").show();
			}else{
				$("#floor").hide();
			}
	})
	//banner-list鼠标移入移出
	$(".left_list li").mouseover(function(){
		$(this).css("background-color","#e6212a").find("b").css("color","white")
		$(".list_content:eq("+$(this).index()+")").show();
	}).mouseout(function(){
		$(this).css("background-color","white").find("b").css("color","black")
		$(".list_content:eq("+$(this).index()+")").hide();
	})
	$(".list_content").mouseover(function(){
		$(this).show();
	}).mouseout(function(){
		$(this).hide();	
	})
	//traval移入移出透明度不变化
	$("#traval li").mouseover(function(){
		$(this).css("opacity",".7");
	}).mouseout(function(){
		$(this).css("opacity","1");
	})
	//brand移入移出bgcolor变化
	$(".brand_wall dd").mouseover(function(){
		$(this).css("background","#f9e5eb");
	}).mouseout(function(){
		$(this).css("background","white");
	})
	//goods移入移出
	$(".goods_content li").mouseover(function(){
		$(this).css("background","#efefef").find("img").css("opacity",".6");
	}).mouseout(function(){
		$(this).css("background","white").find("img").css("opacity","1");
	})
	
	//分享到
	/*$(".share_left").mouseenter(function(){
		$("#share").animate({right:0},500);
	}).mouseout(function(){
		$("#share").animate({right:-272},500);
	})*/
/*	$("#share").mouseenter(function(){
		$(this).animate({right:0},500);
	}).mouseout(function(){
		$(this).animate({right:-272},500);
	})*/
	
	
	
	
	
})


